home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / doodle_d.swf / scripts / DefineSprite_28_en11 / frame_1 / DoAction.as
Text File  |  2013-04-24  |  1KB  |  67 lines

  1. function onEnterFrame()
  2. {
  3.    _rotation = _rotation + spin * 4;
  4.    if(_root.shieldMC.hitTest(_X,_Y,true) && _root.shieldLevel >= 2)
  5.    {
  6.       dx = 0;
  7.       dy = 0;
  8.    }
  9.    timer++;
  10.    if(timer < 20)
  11.    {
  12.       _xscale = _xscale + 4;
  13.       _yscale = _yscale + 4;
  14.    }
  15.    else if(timer < 40)
  16.    {
  17.       _xscale = _xscale - 4;
  18.       _yscale = _yscale - 4;
  19.    }
  20.    else
  21.    {
  22.       timer = 0;
  23.       _xscale = 100;
  24.       _yscale = 100;
  25.    }
  26.    _X = _X + dx;
  27.    _Y = _Y + dy;
  28.    if(_Y > 880 || _Y < 0)
  29.    {
  30.       dy *= -1;
  31.       _Y = _Y + dy * 2;
  32.    }
  33.    if(_X < 0 || _X > 640)
  34.    {
  35.       dx *= -1;
  36.       _X = _X + dx * 2;
  37.    }
  38.    if(this.hitTest(_root.ship))
  39.    {
  40.       depth = _root.getNextHighestDepth();
  41.       _root.attachMovie("exp","exp" + depth,depth);
  42.       exp = eval("_root.exp" + depth);
  43.       exp._x = _X;
  44.       exp._y = _Y;
  45.       _root.eAmount--;
  46.       _root.death();
  47.       this.removeMovieClip();
  48.    }
  49.    if(h <= 0)
  50.    {
  51.       _root.eAmount--;
  52.       _root.points += 300;
  53.       _root.eD = _root.eD + 1;
  54.       depth = _root.getNextHighestDepth();
  55.       _root.attachMovie("exp","exp" + depth,depth);
  56.       exp = eval("_root.exp" + depth);
  57.       exp._x = _X;
  58.       exp._y = _Y;
  59.       this.removeMovieClip();
  60.    }
  61. }
  62. dx = Math.random() * 3 + 3;
  63. dy = (Math.random() * 2 + 2) * -1;
  64. h = 15;
  65. timer = 0;
  66. spin = Math.floor(Math.random() * 3) - 1;
  67.